home *** CD-ROM | disk | FTP | other *** search
- id checkBoxChecked; // WOCheckBox variable
- id objectList; // WOPopUpButton variables
- id anObject;
- id selectedPopUpButton;
- id selectedBrowserItems; // WOBrowser variable -- an array
- // We use WOPopUpButton's 'objectList, and
- // 'anObject'
- id hiddenFieldValue; // WOHiddenField variable
- id textFieldValue; // WOTextField variable
- id passwordFieldValue; // WOPasswordField variable
- id textValue; // WOTextField variable
-
-
- // This method initializes the values for the input elements
- - awake {
-
- if (!checkBoxChecked) {
- checkBoxChecked = YES;
- }
-
- // Array of strings for WOPopUpButton and WOBrowser
- objectList = @("item1","item2","item3", "item4", "item5");
- if (!anObject ) {
- anObject = @"";
- }
-
- if (!selectedPopUpButton) { // on return, selectedPopUpButton stores
- selectedPopUpButton = @"item2"; // the user's selection
- }
-
- if (!selectedBrowserItems) { // on return, selectedBrowserItems stores
- selectedBrowserItems = // the user's selection
- @("item2", "item4");
- }
-
- if (!textFieldValue) { // on return, textFieldValue stores the
- textFieldValue = // text the user entered
- @"Default text";
- }
-
- if (!hiddenFieldValue) {
- hiddenFieldValue = @"Secret Information";
- }
-
- if (!passwordFieldValue) { // WOPasswordField
- passwordFieldValue = @"Default password";
- }
-
- /* Text Value */
- if (!textValue) { // on return, textValue stores the
- textValue = // text the user entered in the WOText
- @"Enter some text.";
- }
- }
-
- // Tell the WOBrowser that multiple selection is allowed.
- - multipleSelectionAllowedInBrowser {
- return YES;
- }
-
- // Send user's inputs to page 2
- - submitForm {
- id aString;
-
- // A checked checked box returns a non-nil value. To make it more
- // readable in Page 2, we'll set it to YES
- if (checkBoxChecked) checkBoxChecked = YES;
-
- // Create a string with the output of the elements in the form
- aString = [NSString stringWithFormat:@"WOCheckBox=%@,
- WOPopUpButton=%@, WOBrowser=%@, WOTextField=%@, WOHiddenField=%@,
- WOPasswordField=%@, WOText=%@", checkBoxChecked,
- selectedPopUpButton, selectedBrowserItems, textFieldValue,
- hiddenFieldValue, passwordFieldValue, textValue];
-
- [WOApp setResultMessage:aString];
- return [WOApp pageWithName:@"Page2"];
- }
-
-